package sharding.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import sharding.entity.HssHistoryEntity;

import java.util.List;


@Mapper
public interface HssHistoryMapper extends BaseMapper<HssHistoryEntity> {
    // 建表
    @Update("CREATE TABLE IF NOT EXISTS ${name} LIKE hss_history")
    void createTable(@Param("name") String name);
    // 查询 sharding好像查不了
    @Select("SHOW TABLES LIKE 'hss_history_%'")
    List<String> showTables();
    // 查询 sharding直接不支持
    @Select("select table_name from information_schema.tables where table_schema='tecloman_dev' and table_name like \"hss_history%\"")
    List<String> showTables2();
}
